<!--
 * @Author: 花香蝶自来 1026583651@qq.com
 * @Date: 2024-04-16 18:35:31
 * @LastEditors: 花香蝶自来 1026583651@qq.com
 * @LastEditTime: 2024-05-28 22:22:16
 * @FilePath: /crm/components/formz/components/formselect.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <view class="">
    <u-popup :show="showfalg" mode="right" width="500rpx">
      <u-navbar title="用户选择" :autoBack="false" @leftClick="popupback" />
      <view style="width: 750rpx;">
        <u-list>
          <u-list-item v-for="(item, index) in list" :key="index">
            <u-cell :title="item.name" @click="tap(item)">

            </u-cell>
          </u-list-item>
        </u-list>
      </view>
    </u-popup>
    <customers2 ref="customers2" @change="change"></customers2>
  </view>
</template>

<script>
import { getCompanyList } from "@/apis/customer/index"
import customers2 from "./customers2.vue";
export default {
  components: {
    customers2
  },
  data() {
    return {
      showfalg: false,
      list: []
    };
  },

  props: {

  },
  methods: {
    async show(item) {
      this.showfalg = true
      let list = await getCompanyList({ customTypeId: item.id });

      // list = list.data.records
      this.list = list.records
    },
    popupback(e) {
      this.showfalg = false
    },
    tap(item) {
      this.$refs.customers2.show(item);
    },
    change(item) {
      this.$emit("change", item)
      this.showfalg = false
    }
  },
};
</script>

<style></style>
